/**
 * Copyright (C), 2019-2020, 宇信融汇
 * FileName: Car
 * Author:   xbliu
 * Date:     2020/6/28 14:49
 * Description: 继承作业
 * History:
 * <author>          <time>          <version>          <desc>
 * xbliu           修改时间           版本号              描述
 */
package c_005;

/**
 * @Classname Car
 * @Description TODO
 * @Date 2020/6/28 14:49
 * @Created by xbliu
 */
public class Car extends MotoVehicle {
    private String type;

    public Car() {
    }

    public Car(String type) {
        this.type = type;
    }

    public Car(int no, String brand, String type) {
        super(no, brand);
        this.type = type;
    }


    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    @Override
    public int calcRent(int day) {
        if (this.type.equals("1")){
            return day * 800;
        }else if(this.type.equals("2")){
            return day * 600;
        }else if (this.type.equals("3")){
            return day * 400;
        }else {
            System.out.println("车辆类型有误");
            return 0;
        }
    }
}
